﻿@{
    Layout = "";
}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
<title>淘房侠</title>
<link rel="apple-touch-icon" href="~/GoTRI/img/favicon-apple.png">
<!--<link rel="icon" href="~/GoTRI/img/favicon.png">-->
<link rel="icon" href="~/admui-13945148017-1592211513218/public/images/48599591f566cbb11c676bd496f2e29 (2).png">
<!--<link rel="icon" sizes="192x192" href="~/admui-13945148017-1592211513218/public/images/apple-touch-icon.png">-->
<!-- Material design icons CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/materializeicon/material-icons.css">

<!-- aniamte CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/animatecss/animate.css">

<!-- swiper carousel CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/swiper/css/swiper.min.css">

<!-- daterange CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/bootstrap-daterangepicker-master/daterangepicker.css">

<!-- footable CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/footable-bootstrap/css/footable.bootstrap.min.css">

<!-- jvector map CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/jquery-jvectormap/jquery-jvectormap-2.0.3.css">

<!-- app CSS -->
<link id="theme" rel="stylesheet" href="~/GoTRI/css/purplesidebar.css" type="text/css">


<!-- Application main common jquery file -->
@*<script src="~/admui-13945148017-1592211513218/public/vendor/bootstrap-sweetalert/sweetalert.min.js"></script>
    <script src="~/admui-13945148017-1592211513218/public/themes/global/js/components/bootstrap-sweetalert.min.js"></script>
    <script src="~/admui-13945148017-1592211513218/public/js/examples/components/advanced/bootbox-sweetalert.min.js"></script>*@
<script src="~/admui-13945148017-1592211513218/public/js/fy/lib/jquery.min.js"></script>
<script src="~/admui-13945148017-1592211513218/public/js/tsk/sweetalert.min.js"></script>
<script>


    function Submit() {
        var WeiXinUserId = $("#divhidden").html();
        var ZhangHao = $("#txt_ZhangHao").val();
        var MiMa = $("#txt_MiMa").val();


        if ($.trim(ZhangHao).length == 0) {
            swal("失败提示!", "请填写账号!", "error");
            return;
        }
        if ($.trim(MiMa).length == 0) {
            swal("失败提示!", "请填写密码!", "error");
            return;
        }



        $.ajax({
            type: "POST",
            url: "../RenYuan/BindWeiXinUserId",
            cache: false,  //禁用缓存
            data: { "WeiXinUserId": "" + WeiXinUserId + "", "ZhangHao": "" + ZhangHao + "", "MiMa": "" + MiMa + "" },  //传入组装的参数
            dataType: "text",
            success: function (result) {
                if (result == "success") {
                    swal("成功提示!", "操作成功!", "success");
                    location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=ww500458ad942a211f&redirect_uri=http://web.xyufu.cn/PhoneShouYe/ShouYe&response_type=code&scope=snsapi_privateinfo&agentid=1000002&state=STATE#wechat_redirect";
                    //setTimeout(function () { window.location.href = "../PhoneShouYe/ShouYe"; }, 2000);
                }
                if (result == "error") {
                    swal("失败提示!", "操作出现异常!", "error");
                }
                if (result == "mimaerror") {
                    swal("失败提示!", "密码错误!", "error");
                }
                if (result == "zhanghaoerror") {
                    swal("失败提示!", "该账号不存在!", "error");
                }
            }
        });

    }

    function getQuery(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]); return null;
    }
</script>
<div id="divhidden" style="display:none;">@ViewData["WeiXinUserId"]</div>
<div class="container mt-4 main-container">
    <div class="card mb-4">
        <div class="card-header border-bottom py-4 text-center">
            <br>
            <h1 class="content-color-primary mb-0 text-center font-weight-light">Account Binding!</h1>
        </div>
        <div class="card-body">
            <div class="row justify-content-center">
                <div class="col-md-10 mx-auto" style="margin-bottom:-40px;">
                    <div class="row ">
                        <div class="col-lg-6 col-md-6">
                            <div class="form-group ">
                                <label>账号<span style="color:red;">*</span></label>
                                <input type="text" id="txt_ZhangHao" class="form-control" placeholder="">
                            </div>
                        </div>
                        <div class="col-lg-6 col-md-6">
                            <div class="form-group ">
                                <label>密码<span style="color:red;">*</span></label>
                                <input type="password" id="txt_MiMa" class="form-control" placeholder="">
                            </div>
                        </div>
                    </div>

                    <br>

                </div>
            </div>
        </div>
        <div class="card-footer" style="text-align: center;width:100%">
            <button class="btn btn-success float-right" onclick="Submit();" style="width:100%">提交</button>
        </div>
    </div>
</div>